-
Notifications
You must be signed in to change notification settings - Fork 558
feat(odsp-client): Add OdspContainerServices readonly and sensitivity label event emitters #25800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
packages/service-clients/odsp-client/src/odspContainerServices.ts
Outdated
Show resolved
Hide resolved
| * Gets the read-only state of the container, if available. | ||
| * @returns The read-only state (true when readonly, false when editable), or undefined if not available. | ||
| */ | ||
| getReadOnlyState(): boolean | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general readonly state is not service-specific, so I'd probably expect to find it on IFluidContainer rather than a container services interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a handy way of exposing functionality via ODSP's beta API, rather than increasing scope to FluidContainer's public API. If you feel this needs to be added to the public API of FluidContainer instead, then we can increase the scope to do that. I worry it will prolong the timeline though, given the public IFluidContainer is a pretty tight subset of all container properties and events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's leave a @privateRemarks block comment noting that this should probably move to the base interface. I agree that moving it probably makes sense, but I don't think we need to block things on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ya know what, looking at this again, I can get the same effect by doing what I did in other PRs via OdspFluidContainer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds event emitters for read-only state and sensitivity label changes to OdspContainerServices, enabling consumers to listen for container state changes. The implementation makes OdspContainerServices extend TypedEventEmitter and implement IDisposable for proper resource management.
Key changes:
- Introduces
IOdspContainerServicesEventsinterface withreadOnlyStateChangedandsensitivityLabelChangedevents - Implements event forwarding from underlying
IContainerevents to service-level events - Adds
getReadOnlyState()method to query current read-only state - Adds disposal pattern to properly clean up event listeners
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/service-clients/odsp-client/src/interfaces.ts | Adds IOdspContainerServicesEvents interface and extends OdspContainerServices with IEventProvider and IDisposable |
| packages/service-clients/odsp-client/src/odspContainerServices.ts | Implements event emitters, disposal pattern, and getReadOnlyState() method |
| packages/service-clients/odsp-client/src/index.ts | Exports new IOdspContainerServicesEvents interface |
| packages/service-clients/odsp-client/package.json | Adds dependency on @fluid-internal/client-utils for TypedEventEmitter |
| pnpm-lock.yaml | Updates lockfile with new dependency |
| PACKAGES.md | Updates layer dependencies to include Client-Utils |
| packages/service-clients/odsp-client/api-report/*.api.md | Updates API surface documentation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/service-clients/odsp-client/src/odspContainerServices.ts
Outdated
Show resolved
Hide resolved
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
| /** | ||
| * Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session. | ||
| */ | ||
| audience: IOdspAudience; | ||
|
|
||
| /** | ||
| * Gets the read-only state of the container, if available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough docs! These are great!
Description
Portion of #25597 to add read-only state and sensitivity labels events to OdspContainerServices.
Reviewer Guidance
I think this PR could be better if it separated read-only events and sensitivity label events, but it will introduce either merge conflicts or blocking on either. I think it would be weird to extend
IEventProviderwithout any events, which would allow for async feature introduction.